local ziren = fk.CreateSkill{
  name = "xiaobai__ziren",
}

Fk:loadTranslationTable{
  ["xiaobai__ziren"] = "眦刃",
  [":xiaobai__ziren"] = "你可以将三张牌当不可响应的【杀】使用，若类别均相同，你使用以此法转化的【杀】可额外指定任意名目标（无距离限制）。",
  ["#xiaobai__ziren"] = "眦刃：你可以将三张牌当不可响应【杀】使用，若类别相同则可额外指定任意名目标（无距离限制）。",
  ["#ziren_chooseTarget"] = "眦刃：你可以额外指定任意名目标（无距离限制）",

  
  ["$xiaobai__ziren1"] = "婢儿学人执兵，却敢窥视某家？",
  ["$xiaobai__ziren2"] = "睚眦尚见血，今番必斫些头颅。",
}

ziren:addEffect("viewas", {
  pattern = "slash",
  anim_type = "offensive",
  card_num = 3,
  prompt = "#xiaobai__ziren",
  card_filter = function (self, player, to_select, selected)
    return not selected or #selected < 3
  end,
  view_as = function (self, player, cards)
    if #cards ~= 3 then
      return
    end
    local card = Fk:cloneCard("slash")
    card.skillName = ziren.name
    card:addSubcards(cards)
    local c = table.map(cards,function (element, index, array)
      return Fk:getCardById(element)
    end)
    if c[1].type == c[2].type and c[2].type == c[3].type then
      card.extra_data = card.extra_data or {}
      card.extra_data.xiaobai__ziren = true
    end
    return card
  end,
  before_use = function (self, player, use)
    if not use.card.extra_data or not use.card.extra_data.xiaobai__ziren then
      return
    end
    local room = player.room
    use.disresponsiveList = table.map(room.alive_players, Util.IdMapper)
    local targets = use.tos
    local tos = UseCardData:new(use):getExtraTargets()
    if #tos > 0 then
      tos = room:askToChoosePlayers(player, {
        targets = tos,
        min_num = 1,
        max_num = 999,
        prompt = "#ziren_chooseTarget",
        skill_name = ziren.name,
        no_indicate = false})
      table.insertTable(targets, tos)
      room:sortByAction(targets)
      room:sendLog{
        type = "#AddTargetsBySkill",
        from = player.id,
        to = table.map(tos, Util.IdMapper),
        arg = ziren.name,
        arg2 = use.card:toLogString()
      }
    end
  end,
  enabled_at_response = function (self, player, response)
    return not response
  end,
  enabled_at_play = Util.TrueFunc;
})

return ziren